Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace obsolete TransformComponent.Anchored set #5548

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MilenVolf
Copy link
Contributor

@MilenVolf MilenVolf commented Dec 3, 2024

For #33279

This PR also adds new condition to the AnchorEntity for case when MapGridComponent is null.

@PJB3005
Copy link
Member

PJB3005 commented Dec 4, 2024

Bro got got by the exact same thing that made me skip out on fixing these warnings
image

@metalgearsloth
Copy link
Contributor

AnchorEntity is not a drop-in replacement because the anchored setter does the slow-path of tryfindgridat.

@MilenVolf
Copy link
Contributor Author

AnchorEntity is not a drop-in replacement because the anchored setter does the slow-path of tryfindgridat.

I'll add additional condition then to keep old behaviour for cases like this

It reparents and rises move event, that were not used in obsolete setter
Comment on lines +127 to +133
{
if (!_mapManager.TryFindGridAt(GetMapCoordinates(entity.Comp), out var gridUid, out var gridMapComp))
return false;
grid = (gridUid, gridMapComp);
}
else
grid = (entity.Comp.GridUid.Value, gridComp);
Copy link
Contributor

@metalgearsloth metalgearsloth Jan 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I'm a bit suss on because it will fallback to the slowpath where previously it would just return false. Ideally this shouldn't even be happening because the entity itself should already have a griduid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants